import time
import urllib
import urllib.request
import shutil
import os
import tkinter as tk
event="wtf"
api = "http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp"
getd = urllib.request.urlopen(api)
getd = getd.read().decode('utf-8')
print(getd)
getp = getd.split('\"')
getp = getp[-2]
#print("当前时间：" + getp)
timenow = int(getp)
f = open("time_device.ini",'r')
k = f.readline()
num_k = int(k)
remain_time = num_k - timenow
#print(remain_time)
remain_days = remain_time / 86400000
remain_days = ("{:.0f}".format(remain_days))
#print(remain_days)
root = tk.Tk()
root.attributes("-toolwindow", 1)
root.wm_attributes('-topmost',True)
root.attributes('-alpha',0.6)
root.geometry("280x180+1632+-30")
root.title("倒计时Powered By Summer")
labl1 = tk.Label(root,text=f"距离{event}剩余",font=('微软雅黑',30))
strdays = str(remain_days)
labl2 = tk.Label(root,text=strdays , font=('Consolas',30),fg = "red")
labl3 = tk.Label(root,text="天" , font=('微软雅黑',30))
labl1.pack()
labl2.pack()
labl3.pack()
root.mainloop()